<!DOCTYPE HTML >
<html>
    <head>
        <title>jQuery Validate扩展验证方法</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <meta http-equiv="pragma" content="no-cache">
        <meta http-equiv="cache-control" content="no-cache">
        <meta http-equiv="expires" content="0">
        <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
        <meta http-equiv="description" content="This is my page">
		<script src="../js/jquery.min.js"></script>
		 <script src="../js/jquery.validate.min.js"></script> 

		<!-- <script src="http://static.runoob.com/assets/jquery-validation-1.14.0/lib/jquery.js"></script> -->
		<!-- <script src="http://static.runoob.com/assets/jquery-validation-1.14.0/dist/jquery.validate.min.js"></script> -->
		<!-- <script src="http://static.runoob.com/assets/jquery-validation-1.14.0/dist/localization/messages_zh.js"></script> -->
		<script src="../js/additional-methods.js"></script>
		
        <script type="text/javascript">
			$.validator.setDefaults({
				submitHandler: function() {
				  alert("提交事件!");
				}
			});
			$().ready(function() {
		// 在键盘按下并释放及提交后验证提交表单
		  $("#signupForm").validate({
			rules: {
				ch : {"onlych":""},
				"dlist[2].stationname" : {"onlych":"true"},
			},
			messages: {
			  ch:"必须是中文",
			  "dlist[2].stationname":"必须是中文"
			}
			});
		});
        </script>
    </head>


    <body>
       <form class="cmxform" id="signupForm" method="get" action="">
  <fieldset>
    <legend>自定义校验规则</legend>
	<p>
      <label for="firstname">中文</label>
      <input id="ch" name="ch" type="text">
    </p>
	<p>
	<label for="a">测试</label>
	<input id="a" name="dlist[2].stationname" type="text"  data-minlength="1" maxlength="32" required="required" value=""  placeholder="请输入到站名称" aria-required="true">
	 </p>
  <p>
      <input class="submit" type="submit" value="提交">
    </p>
  </fieldset>
</form>
    </body>
</html>

